<template>
    <div style="width: 15%; background-color: white;text-align: center;padding: 20px;border-right: 1px solid #f5f6f8;">
        <el-input v-model="searchs" style="width: 100%;border-radius: 0px" placeholder="输入员工姓名全员搜索" @change="search" />
        <el-tree style="max-width: 600px" :data="store.$state.ruleLeft" default-expand-all :props="defaultProps"
            @node-click="handleNodeClick" />
    </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { useStore } from '../../stores/counter'
const store = useStore()
let searchs = ref('')
onMounted(() => {
    store.render2()
});
const handleNodeClick = (data: any) => {
    store.render(1, 10, '', data.id)
}
const defaultProps = {
    children: 'children',
    label: 'name',
}
const search = () => {
    store.render(1, 10, searchs.value, store.$state.ruleleftid)

}
</script>

<style scoped></style>